import { createStore } from 'vuex'
import menus from './modules/menus';
export default createStore({
  state: {
    token:'',
    userInfo:{}
  },
  mutations: {
    SET_TOKEN(state,token){
      state.token = token;
      localStorage.setItem("token",token);
    },
    clearAllData(state){
      state.token = '';
      state.menuList = [];
      state.permList = [];
      state.hasRoutes = false;
    },
    SET_USERINFO(state,userInfo){
      state.userInfo = userInfo
    }
  },
  actions: {
  },
  getters: {
  },
  modules: {
    menus
  }
})
